// login.js
//获取应用实例
const app = getApp()
// const qs = require('../../utils/qs.js')

Page({
  data: {
    items: []
  },
  //事件处理函数
  handleSignin: function (event) {
    console.log(event.detail.value)
    
    wx.request({
      url: app.globalData.baseUrl + '/bm/opera/login',
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        account: event.detail.value.username,
        userPassword: event.detail.value.userpwd
      },
      success(res) {
        if (res.data.code == 200) {
          console.log('登陆成功！')
        } else {
          console.log(res.data.description)
        }
      }
    })
  },
  onLoad: function () {

  },
  getUserInfo: function (e) {
    console.log(e)
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  }
})
